<template>

  <div class="ha">
    <div v-if="!post">
      <tabbar>
        <tabbar-item>
          <img slot="icon" src="//img03.fn-mart.com/pic/6b8e133d8a9b25f9ee6c/h28z22sT_nLdhlugOT/79eyoGcajijYfG/CsmRsVkcAdmAUAlsAABAESUnFkk651_org_q75s500.png">
          <span slot="label">首页</span>
        </tabbar-item>
        <tabbar-item show-dot link="/classify">
          <img slot="icon" src="//img04.fn-mart.com/pic/e546133d0d861b9dd58b/kTH222sTvTtMhdUlX2/1xoamRJySGdaZa/CsmRsljKBwWAf037AAAI5XnFrZc695_org_q75s500.png">
          <span slot="label">商品分类</span>
        </tabbar-item>
        <tabbar-item v-if="!datas" link="/login">
          <img slot="icon" src="//img03.fn-mart.com/pic/1b57133d0d8e1b9ee5b0/K282nn7n_TLMKlVgXn/5iSymGEyoRMyua/CsmRsVjKBxaAG_jNAAAI7p2defI106_org_q75s500.png">
          <span slot="label">购物车</span>
        </tabbar-item>
        <tabbar-item v-if="datas" link="/shoping">
          <img slot="icon" src="//img03.fn-mart.com/pic/1b57133d0d8e1b9ee5b0/K282nn7n_TLMKlVgXn/5iSymGEyoRMyua/CsmRsVjKBxaAG_jNAAAI7p2defI106_org_q75s500.png">
          <span slot="label">购物车</span>
        </tabbar-item>
        <tabbar-item v-if="!datas" link="/login">
          <img slot="icon" src="//img02.fn-mart.com/pic/cd2b133d0d8c1b9feef8/h28z22sT_nLdhlugOT/19maoacGmRgauG/CsmRsVjKByaAbj9NAAAK27VGcec711_org_q75s500.png">
          <span slot="label">我的账户</span>
        </tabbar-item>
        <tabbar-item v-if="datas" badge="6" link="/myde">
          <img slot="icon" src="//img02.fn-mart.com/pic/cd2b133d0d8c1b9feef8/h28z22sT_nLdhlugOT/19maoacGmRgauG/CsmRsVjKByaAbj9NAAAK27VGcec711_org_q75s500.png">
          <span slot="label">我的账户</span>
        </tabbar-item>
      </tabbar>
    </div>
    <div v-if="post">
      <tabbar>
        <tabbar-item>
          <img slot="icon" src="//img03.fn-mart.com/pic/6b8e133d8a9b25f9ee6c/h28z22sT_nLdhlugOT/79eyoGcajijYfG/CsmRsVkcAdmAUAlsAABAESUnFkk651_org_q75s500.png">
          <span slot="label">首页</span>
        </tabbar-item>
        <tabbar-item v-if="!datas" link="/add">
          <img slot="icon" src="//img04.fn-mart.com/pic/e546133d0d861b9dd58b/kTH222sTvTtMhdUlX2/1xoamRJySGdaZa/CsmRsljKBwWAf037AAAI5XnFrZc695_org_q75s500.png">
          <span slot="label">添加商品</span>
        </tabbar-item>
        <tabbar-item v-if="!datas" link="/ment">
          <img slot="icon" src="../assets/01.png" style="height:23px">
          <span slot="label">商品管理</span>
        </tabbar-item>
      </tabbar>
    </div>
  </div>
</template>
<script>
  import axios from 'axios'
  import { Tabbar, TabbarItem, Group, Cell } from 'vux'
  export default {
    components: {
      Tabbar,
      TabbarItem,
      Group,
      Cell
    },
    data() {
      return {
        post: '',
        datas: ''
      }
    },
    mounted: function () {
      var that = this;
      axios.get('los/login').then(function (data) {
        that.datas = data.data.message.name;
        that.post = data.data.message.post;
      }).catch(function (err) {
        console.log(err);
      })
    },

  }

</script>
<style scoped>
  .ha {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
  }
</style>